home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 031a / owlbwcc.zip / BWCHECK.CPP < prev    next >
C/C++ Source or Header  |  1992-02-02  |  2KB  |  50 lines

  1. /**********************************************************************/
  2. /*                  BWCHECK.cpp by Bob Bourbonnais                    */
  3. /*              released to the public domain 2/02/92                 */
  4. /*          This program shows how to display a dialog as             */
  5. /*                      The main window.                              */
  6. /**********************************************************************/
  7. #include <owl.h>
  8. #include <dialog.h>
  9. #include "bwcc.h"                        // needed for BWCC
  10.  
  11. class TMyDialog : public TDialog
  12.   {
  13.   public:
  14.     TMyDialog(LPSTR lpDialogName)          // constructor calls
  15.       : TDialog(NULL,lpDialogName)         // base class constructor
  16.       {
  17.       BWCCGetVersion();    // activate Borland Windows Custom Controls
  18.       }
  19.  };
  20.  
  21. class TDialog1App : public TApplication  // Application Class to contain
  22.   {                                      // the application
  23.   public:
  24.     TDialog1App(LPSTR lpName, HANDLE hInstance,  // constructor calls the
  25.         HANDLE hPrevInstance,            // base class constructor
  26.         LPSTR lpCmdLine, int nCmdShow)
  27.         :TApplication(lpName, hInstance,
  28.                   hPrevInstance,
  29.                   lpCmdLine, nCmdShow) {};
  30.  
  31.     virtual void InitMainWindow(); // overrides base class InitMainWindow
  32.   };
  33.  
  34. void TDialog1App::InitMainWindow() // to initialize a dialog box
  35.   {                                // as the main window
  36.   MainWindow = new TMyDialog("MAINWINDOWDIALOG");
  37.   }
  38.  
  39. int PASCAL WinMain(HANDLE hInstance,              // main entry point from
  40.            HANDLE hPrevInstance,          // windows to this program
  41.            LPSTR lpCmdLine , int nCmdShow)
  42.   {
  43.   TDialog1App Dialog1("Dialog Tester",hInstance,  // create instance of
  44.                hPrevInstance,             // the dialog application
  45.                lpCmdLine,nCmdShow);
  46.   Dialog1.Run();                                  // run it
  47.   return (Dialog1.Status);                        // exit
  48.   }
  49. /**********************************************************************/
  50.